package com.example.demo.util;

import com.aep.cloud.AepCloudClient;
import com.aep.cloud.client.AepClient;
import com.aep.cloud.client.request.AepRequest;
import com.aep.cloud.client.response.AepResponse;
import com.aep.cloud.http.MethodType;
import com.aep.cloud.json.JSONObject;

public class Main {
    public static void main(String[] strings) {

        //接口地址以及AppKey
        AepClient aepClient = new AepCloudClient("http://59.208.149.106:81/api","770304097134837760","29691e105c2045e7a8b41414e27e9ca6");
        AepRequest request = new AepRequest();
        request.setIsEncryption(false);
        //配置调用方式，是get还是post
        request.method(MethodType.POST);
        //配置要调用的接口的路径，具体路径有什么作用可以在http://59.208.149.106/aep/或者文档中查看
        request.setApiUrl("/standard/transact/project/selectTransactList");
        JSONObject json = new JSONObject();
        //配置调用接口中要传入的参数放入json类中 具体接口要求传入哪些参数可以在http://59.208.149.106/aep/或者文档中查看
        json.put("page","1");
        json.put("limit","10");
        json.put("regionCode","420000000000");
        try {
            AepResponse response = aepClient.execute(request);
            JSONObject json1  = new JSONObject(response.getData().toString());
            JSONObject json2  = new JSONObject(json1.get("data").toString());
            JSONObject data = json2.getJSONObject("data");
            System.out.println(json2);
        }catch(Exception e) {
            e.printStackTrace();
        }
    }
}
